///////////////////////////////////////////////////////////
//  OQLSimpleCondition.cpp
//  Implementation of the Class OQLSimpleCondition
//  Created on:      23-sep-2007 21:26:17
///////////////////////////////////////////////////////////

#include "OQLSimpleCondition.h"
#include "ResolveDBRequest.h"

OQLSimpleCondition::OQLSimpleCondition(){

}

OQLSimpleCondition::OQLSimpleCondition(campo* att, std::string op, std::string value){
	this->atributte = att;
	this->operat = op;
	this->value = value;
}

OQLSimpleCondition::~OQLSimpleCondition(){

}

std::string OQLSimpleCondition::getName(){
	
	return "OQLSimpleCondition";
}

campo* OQLSimpleCondition::getAttribute()
{
	return this->atributte;
}

void OQLSimpleCondition::setAttribute(campo* atributo)
{
	this->atributte = atributo;
}

std::string OQLSimpleCondition::getOperator()
{
	return this->operat;
}

void OQLSimpleCondition::setOperator(std::string operador)
{
	this->operat = operador;
}

std::string OQLSimpleCondition::getValue()
{
	return this->value;
}

void OQLSimpleCondition::setValue (std::string val){
	this->value = val;
}

ListPersistent OQLSimpleCondition::resolve(std::string tabla){
	ListPersistent list;
	ResolveDBRequest res;
		
	table.assign(tabla);
	list = res.resolveSimple((*this));
	
	return list;
}

void OQLSimpleCondition::erase()
{
	// No hace absolutamente nada
}

